package cn.creditease.std.consumer;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description: job消费者中心
 * @Author: kai.yang
 * @Date: 2019-08-07 10:53
 */
public class JobConsumerRegistory {

    /**
     * 定义的消费者注册中心
     */
    private static Map<String, JobConsumer> jobConsumerRegistory = new HashMap<>();


    /**
     * 根据jobName找到对应的消费者
     */
    public static JobConsumer getConsumer(String jobName) {
        return jobConsumerRegistory.get(jobName);
    }

    /**
     * 注册一个job
     */
    public static void registry(String jobName, JobConsumer jobConsumer) {
        jobConsumerRegistory.put(jobName, jobConsumer);
    }




}
